home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Internet Tools 1993 July / Internet Tools.iso / RockRidge / ip / ppp / dp-2.3 / sys / RCS / predpunload,v < prev    next >
Encoding:
Text File  |  1993-01-28  |  1.1 KB  |  97 lines

  1. head     1.2;
  2. branch   ;
  3. access   ;
  4. symbols  ;
  5. locks    ; strict;
  6. comment  @# @;
  7.  
  8.  
  9. 1.2
  10. date     93.01.28.15.26.36;  author ks;  state Exp;
  11. branches ;
  12. next     1.1;
  13.  
  14. 1.1
  15. date     93.01.19.14.50.39;  author ks;  state Exp;
  16. branches ;
  17. next     ;
  18.  
  19.  
  20. desc
  21. @@
  22.  
  23.  
  24. 1.2
  25. log
  26. @New pathname stuff.. 
  27. @
  28. text
  29. @#!/bin/sh
  30. #
  31. # Stop the daemon, mark interfaces down, kill routes and then unload
  32. # the modules
  33.  
  34. DEVICE=/dev/dp0
  35. . /etc/dp.conf
  36.  
  37. #
  38. # Kill the daemon
  39. #
  40. kill -TERM `cat $DPPID_DIR/dpd`
  41.  
  42. #
  43. # ifconfig 'down' interfaces
  44. #
  45. if [ -f $DPCONF_DIR/dp-if ]; then
  46.     cat $DPCONF_DIR/dp-if | (
  47.         while read IFNAME LOCAL REMOTE
  48.         do
  49.             ifconfig $IFNAME down
  50.         done
  51.     )
  52. fi
  53.  
  54. #
  55. # kill routes from netstat output
  56. #
  57.  
  58. netstat -n -r | (
  59.     read line1
  60.     read line2
  61.     while read DEST GATE FLAGS REFCNT USE INTERFACE
  62.     do
  63.         if [ "`echo $INTERFACE | cut -c1,2`"X = "dp"X ]; then
  64.             route delete $DEST $GATE
  65.         fi
  66.     done
  67.     )
  68.  
  69. #
  70. # let it quiet down a bit ...
  71. #
  72. sleep 2
  73.  
  74. # OK - exit true
  75. exit 0
  76. @
  77.  
  78.  
  79. 1.1
  80. log
  81. @Initial revision
  82. @
  83. text
  84. @d7 1
  85. a7 3
  86. DPDIR=/etc/dp
  87. BINDIR=/usr/etc
  88. LOGDIR=/var/adm/dp
  89. d12 1
  90. a12 1
  91. kill -TERM `cat $LOGDIR/PID.dpd`
  92. d17 2
  93. a18 2
  94. if [ -f $DPDIR/config/dp-if ]; then
  95.     cat $DPDIR/config/dp-if | (
  96. @
  97.